﻿<UserControl x:Class="ine.Views.TransferControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:ine.Views"
             mc:Ignorable="d" d:DesignHeight="400" d:DesignWidth="1000">
    <Grid>
        <StackPanel Height="30" VerticalAlignment="Top" Orientation="Horizontal">
            <Button Content="New" Width="100" Click="HandleNew" />
            <Button Content="Start" Width="100" Click="HandleStart"
                    IsEnabled="{Binding Path=CanStart, Mode=OneWay}"/>
            <Button Content="Stop" Width="100" Click="HandleStop"
                    IsEnabled="{Binding Path=CanStop, Mode=OneWay}"/>
            <Button Content="Remove" Width="100" Click="HandleRemove"
                    IsEnabled="{Binding Path=CanRemove, Mode=OneWay}"/>
        </StackPanel>
        <StackPanel Height="30" VerticalAlignment="Top" Orientation="Horizontal" HorizontalAlignment="Right">
            <TextBox x:Name="filter" Width="250" VerticalContentAlignment="Center" TextChanged="HandleFilterChanged"/>
        </StackPanel>
        <ListView x:Name="list" Margin="0,35,0,0" ItemsSource="{Binding Path=Resources}">
            <ListView.View>
                <GridView AllowsColumnReorder="False">
                    <GridViewColumn Header="Filename" Width="480">
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Path=Name}" TextAlignment="Left" TextTrimming="CharacterEllipsis">
                                    <TextBlock.ToolTip>
                                        <TextBlock Text="{Binding Path=Name}"/>
                                    </TextBlock.ToolTip>
                                </TextBlock>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <GridViewColumn Header="Size" Width="100">
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Path=Size}" TextAlignment="Right"/>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <GridViewColumn Header="Status" Width="110">
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Path=Status}" TextAlignment="Center"/>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <GridViewColumn Header="Completed" Width="90">
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Path=Completed}" TextAlignment="Right"/>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <GridViewColumn Header="Speed" Width="100">
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Path=Speed}" TextAlignment="Right"/>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <GridViewColumn Header="ETA" Width="100">
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Path=Estimation}" TextAlignment="Right"/>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                </GridView>
            </ListView.View>
        </ListView>
    </Grid>
</UserControl>
